<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>ES6的新语法特性</title>
	</head>
	<body>
		<script type="text/javascript">
			var qw1 = function(a, b) {
				return a + b;
			};
			// 上面函数可以改写为下面的箭头函数
			var qw = (a, b) => a + b;
			document.write("正常函数a+b为" + qw1(5, 6) + "<br />")
			document.write("箭头函数a+b为" + qw(5, 6));

			// Spread / Rest 操作符
			function foo(x, y, z) {
				console.log(x, y, z);
			}
			let arr = [1, 2, 3];
			foo(...arr); // 1 2 3

			function foo(...args) {
				console.log(args);
			}
			foo(1, 2, 3, 4, 5);
		</script>
	</body>
</html>
